home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / t_ref5.arc / T-REF.DOC < prev    next >
Text File  |  1991-04-28  |  87KB  |  2,311 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                                 T-Ref 5.03S
  11.  
  12.                             (Shareware Version)
  13.  
  14.  
  15.               A Source Listing and Cross Referencing Program
  16.  
  17.                        For Turbo Pascal 4.0 and 5.0
  18.  
  19.  
  20.           Copyright (C) 1986, 1989 by Synergy Software Solutions
  21.  
  22.                               P. O. Box 28625
  23.                            Papillion, NE  68046
  24.  
  25.                           CompuServe # 72617,1411
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                           Legal Rights and Issues
  71.  
  72.  
  73.           Synergy   Software  Solutions  (hereafter  denoted  as  SSS) 
  74.      retains all rights of ownership of the product called T-Ref under 
  75.      United  States and International laws of commerce.   T-Ref  is  a 
  76.      copyright  of  SSS.  However SSS hereby expressly authorizes  the 
  77.      willful  distribution  of the enclosed software  to  other  indi-
  78.      viduals  or companies.   SSS does NOT authorize,  nor waive,  any 
  79.      other rights provided under the protection of copyright laws, and 
  80.      reserves the right to withdraw distribution rights at any  future 
  81.      time.  At such time, notice will be given.
  82.  
  83.  
  84.      This Version:
  85.  
  86.           T-Ref  Version  5.03S is a shareware product.   It is NOT  a 
  87.      public domain or freeware program.   Shareware means that you are 
  88.      given  a  specific  period of time in which to test  the  product 
  89.      before  you are required to register your  copy.   Thus,  if  you 
  90.      decide to use T-Ref,  you are expected to REGISTER your copy with 
  91.      SSS.   
  92.           SSS  gives  all potential personal and/or  company/corporate 
  93.      buyers  a full 60 day trial period in which to determine  whether 
  94.      T-Ref is of use to them.   At such point, individuals using T-Ref 
  95.      for  personal use are expected to register their copy  with  SSS.  
  96.      Companies and corporations that use T-Ref beyond the 60-day trial 
  97.      period  MUST  register their copy with SSS,  or CEASE use of  the 
  98.      product.  
  99.  
  100.           Special discounts are available for site licensing.   Regis-
  101.      tration fees are noted in the file REGISTER.FRM.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                              Table of Contents
  137.  
  138.      Preface
  139.           T-Ref Light                                       i
  140.           Package Files                                     i
  141.           System Requirements                               i
  142.           Limitations                                       ii
  143.           Before Getting Started                            ii
  144.           Commitment                                        ii
  145.  
  146.      Chapter 1 - Introduction to T-Ref
  147.           What T-Ref Can Do                                 1-1
  148.           T-Ref's "Driver" Program                          1-2
  149.                1. File I/O Area                             1-2
  150.                2. Source Lister Area                        1-2
  151.                3. Cross Reference Lister Area               1-3
  152.                4. Function Keys                             1-3
  153.                5. Changing the Parameter Settings           1-4
  154.                6. Exiting T-Ref                             1-5
  155.                7. Executing the "Scanner" Program           1-5
  156.                8. T-Ref's "Scanner" Window                  1-5
  157.  
  158.      Chapter 2 - The Source Lister
  159.           Activating the Source Lister                      2-1
  160.           Parameter Options                                 2-1
  161.           Reserved Words and Identifiers                    2-1
  162.           Line Numbering                                    2-2
  163.           Lexical Level Numbering                           2-2
  164.           Block Level Numbering                             2-3
  165.           Block Diagramming                                 2-3
  166.           Auto-Commenting                                   2-3
  167.           Active Procedure/Function                         2-4
  168.           Header Markers                                    2-4
  169.  
  170.      Chapter 3 - The Cross Reference Lister
  171.           Activating the Reference Lister                   3-1
  172.           Detail Level                                      3-1
  173.           Object Selection                                  3-2
  174.           Scanning Within Conditional Compilation           3-2
  175.           Procedural Table Listing                          3-2
  176.           Code Analysis                                     3-3
  177.           Undeclared Identifiers                            3-3
  178.           Interpreting the Reference Listing                3-3
  179.           Hardwired Identifiers                             3-6
  180.  
  181.      Chapter 4 - Common Features
  182.           Handling Include Files                            4-1
  183.           Defining Listing Headers                          4-1
  184.           Page Numbering                                    4-2
  185.  
  186.      Chapter 5 - I/O Control Features
  187.           Screen Control                                    5-1
  188.           Printer Control                                   5-2
  189.           File Control                                      5-3
  190.      Chapter 6 - T-Ref Quick Start
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.           Backing up T-Ref                                  6-1
  203.           Building the Database File                        6-1
  204.           Executing T-Ref                                   6-1
  205.           Setting the Default Parameters                    6-1
  206.           Saving the New Settings                           6-3
  207.  
  208.      Chapter 7 - Commercial Version of T-Ref
  209.           The T-Ref Shell                                   7-1
  210.           The Scanner Program                               7-2
  211.           The Source Lister                                 7-2
  212.           The Cross Referencer                              7-2
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   PREFACE
  269.  
  270.           Welcome to the shareware version of THE BEST source  listing 
  271.      and cross referencing program for Turbo Pascal 4.0 and 5.0.   But 
  272.      don't  take my word for it.   You'll see for yourself that it  is 
  273.      better  than any other shareware program of its type or EVEN  any 
  274.      commercial product!   And it is offered at a shareware price!  It 
  275.      is  flexible through its precise and  accurate  information,  and 
  276.      best of all,  it's easy to use.
  277.           Details  about  what T-Ref can do are part  of  the  program 
  278.      through  context-sensitive  help windows,  so this document  file 
  279.      will  be fairly short.   T-Ref will provide you with  details  on 
  280.      nearly every option available.
  281.  
  282.  
  283.      T-Ref Light:
  284.  
  285.           With  the release of this shareware version,  I actually now 
  286.      have  two  different versions of T-Ref.   The  other  version,  a 
  287.      commercial  ("industrial  grade")  version,  has  about  a  dozen 
  288.      features this version does NOT have.  This does not mean that the 
  289.      shareware  version  suffers  some  form  of  malnutrition  or   a 
  290.      deformity   that  will  restrict  your  abilities  to  print  and 
  291.      reference  your  source files.   However,  some of  the  advanced 
  292.      features   available   on  the  commercial  version   have   been 
  293.      "inhibited".   Chapter  7 details the features offered only  with 
  294.      the commercial version.
  295.           Also,  the documentation released with this version is meant 
  296.      to  be  short (due to limited space  for  distribution  purposes) 
  297.      while  still  giving as much details about the program as  neces-
  298.      sary.   A much more comprehensive and complete manual set (nearly 
  299.      100  pages of material) comes with the $25 and  $45  registration 
  300.      levels.   This  manual  documents warnings and  errors,  provides 
  301.      insights to how to use T-Ref more effectively, and describes some 
  302.      features not documented in this abridged copy.
  303.  
  304.  
  305.      Package Files:
  306.  
  307.           The files that come with this shareware version of T-Ref are
  308.  
  309.           T-REF.EXE      The main driver program
  310.           T-REFSCN.EXE   The scanner sub-program (called by T-REF)
  311.           T-REF.HLP      On-Line Context-Sensitive Help File
  312.           INITDB.EXE     This program builds the database program used
  313.                          by T-Ref
  314.           T-REF.DOC      This document file
  315.           REGISTER.FRM   Registration forms for registering T-Ref
  316.  
  317.  
  318.      System Requirements:
  319.  
  320.           T-Ref requires an IBM-PC or compatible system with a minimum 
  321.      of 256K of memory and either MS-DOS or PC-DOS 2.0 or greater.
  322.  
  323.  
  324.  
  325.                                      i
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      Limitations:
  335.  
  336.           There are a few T-Ref limitations you should first be  aware 
  337.      of.  These are:
  338.  
  339.           1)  The  maximum length of an identifier is  20  characters.  
  340.      Longer identifiers will be cut to 20 characters.
  341.           2)   Diagram  blocking is limited to the first  eight  block 
  342.      levels of the procedure's code.
  343.  
  344.  
  345.      Before Getting Started:
  346.  
  347.           Before  anything else,  I suggest you make a backup copy  of 
  348.      all  the  files  in this package before using  them.   Store  the 
  349.      backup copy in a safe place.
  350.           Also, before running T-REF, you must run the program INITDB, 
  351.      which will create the database file needed for T-REF.
  352.  
  353.  
  354.      Commitment:
  355.  
  356.           I have a strong commitment to the registered users of T-Ref.  
  357.      This  package  has been marketed as shareware  and/or  commercial 
  358.      software  for  over  two years now.   I have made  over  a  dozen 
  359.      enhancements and corrections to it since its original version 1.0 
  360.      release,  some of which were made as suggestions from  registered 
  361.      users.
  362.           I  am also committed to continuing the development of  T-Ref 
  363.      further.   I already have four more major enhancements slated for 
  364.      T-Ref  over  the  next  six months (by end  of  the  year  1989).  
  365.      Included  in  this  is  a  formatter,  which  will  automatically 
  366.      reformat code to the styles selected by the user.
  367.           Finally,  if you experience any difficulties with running T-
  368.      Ref,  please let me know.  I have made every effort to provide as 
  369.      bug-free  of  a  program as possible,  but know it is  still  not 
  370.      entirely  perfected.   I  can  only make the  product  better  by 
  371.      getting good feedback from its users, registered or not.
  372.           Also,  if you have any ideas of how to make T-Ref better,  I 
  373.      am always open to suggestions.   Constructive criticism is always 
  374.      welcome!
  375.  
  376.      Sincerely,
  377.  
  378.  
  379.      Jim D. Hart
  380.      President, Synergy Software Solutions
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                      ii
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                      Chapter 1 - Introduction to T-Ref
  401.  
  402.      What T-Ref Can Do:
  403.  
  404.           T-Ref  is  actually  two  programs combined  into  a  single 
  405.      package.  First, it is a Source Lister for Borland's Turbo Pascal 
  406.      compiler (version 5.0).   Of course,  T-Ref's sophistication  for 
  407.      listing  the source files is far beyond just printing the  source 
  408.      code.   For  example,  along  with the source  listing,  you  can 
  409.      specify  a line- by-line print-out of the lexical levels and  the 
  410.      block levels,  the active procedure or function of that line, and 
  411.      the  line  numbers  along with the listing.   Chapter 2  of  this 
  412.      document  describes in detail how to create a source  listing  to 
  413.      match your specific needs.  
  414.           The second part of T-Ref is the Cross Reference List,  which 
  415.      was specifically designed to cross reference programs written for 
  416.      Borland's Turbo Pascal.   It will give a complete cross reference 
  417.      of  all  identifiers  declared within a  program,  or  a  partial 
  418.      listing  (on  requested object types).   The listing  gives  each 
  419.      identifier's name, its type, the code line declared on, all lines 
  420.      referencing  the names,  and the scope (the procedure or function 
  421.      name  and  level in which the identifier  was  declared  within).  
  422.      Chapter  3 describes how to print and interpret a cross reference 
  423.      listing.
  424.           These two parts were designed to work in tandom: with just a 
  425.      few  key strokes,  you can get either a source listing,  a  cross 
  426.      reference listing,  or both.  Output can be routed to a specified 
  427.      output file or to the system's list device (printer).
  428.  
  429.           T-Ref  is  a syntax-scanning program,  or simply  a  scanner 
  430.      (sometimes called a parser).   The scanner performs  associations 
  431.      between a program's source code and the language's grammar.  This 
  432.      is  to  say  that T-Ref understands the  language  structure  (or 
  433.      syntax)  of Turbo Pascal.   It "scans" the input file for identi-
  434.      fiers (first for their declarations and then for their uses)  and 
  435.      stores the references made to them.  However, T-Ref has one limi-
  436.      tation  in dealing with an input source file:  it is not designed 
  437.      to  recover from syntax errors found in the program and  continue 
  438.      "scanning" the source.
  439.  
  440.           T-Ref  can successfully scan a complete Turbo Pascal program 
  441.      file,  a program "unit" file,  or a declaration part of a program 
  442.      (usually  kept in an "Include file").  The declaration part of  a 
  443.      program  may include a sequence of one or more of the  following: 
  444.      label  declarations,  constant declarations,  type  declarations, 
  445.      variable declarations,  and procedure and function  declarations.  
  446.      (Like  Turbo  Pascal,  there is no restrictions on order or  fre-
  447.      quency  of each type of declaration.)  Therefore,  it is possible 
  448.      to  scan  a set of library procedures and functions placed  in  a 
  449.      separate file (accessed from the main program through the include 
  450.      file  compiler  directive)  without having to  scan  any  of  the 
  451.      possibly many main programs that may use that library.
  452.  
  453.           T-Ref  WILL NOT scan a sequence of code instructions  alone.  
  454.      If  you  wish  to  retrieve  a cross reference  of  only  a  code 
  455.  
  456.  
  457.                                     1-1
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      sequence,  you can enclose the code in a "BEGIN" ... "END." block 
  467.      and T-Ref will assume the code is a program.
  468.  
  469.  
  470.      T-Ref's "Driver" Program:
  471.  
  472.           Almost all interactions you will make with the program  will 
  473.      be  done  through the "driver" program (or shell)  which  appears 
  474.      when  T-Ref  begins execution.  The main screen is  divided  into 
  475.      three  major areas:  the file I/O parameters,  the source  lister 
  476.      parameters, and the cross reference lister parameters.
  477.  
  478.      File I/O Area
  479.  
  480.           The  File  I/O  parameters are used to  specify  the  common 
  481.      directory and subdirectories names ("Active Directory"), the name 
  482.      of the file where the program to be parsed resides ("Active Input 
  483.      File"),  and  the  name  of the output file where  the  resulting 
  484.      listing  is  to  be sent ("Active  Output  File").   The  "Active 
  485.      Directory" parameter,  when used,  refers to the directory common 
  486.      to  the  input  file,  the output file,  and  all  include  files 
  487.      referenced within the input file (the program).  The exception to 
  488.      this case is when the input or output file parameters begin  with 
  489.      the  "\" symbol or a drive symbol "d:".   This is interpreted  to 
  490.      mean "The specified file name includes the directory and possible 
  491.      subdirectories  for  the file's location."  
  492.           The Input File and Output File may also reference  subdirec-
  493.      tories within the directory (and subdirectories) specified by the 
  494.      Directory parameter.
  495.           If  a  file name extension (file type) is not given  in  the 
  496.      input file parameter or the output file field,  '.PAS' and '.PRT'
  497.      are respectively assumed.   
  498.           T-Ref  supports  the capability to change the  default  file 
  499.      extension  names.   This  is  covered in Chapter  5  under  "File 
  500.      Control".
  501.           To  send the output to the printer,  just blank the  'Active 
  502.      Output File' parameter.  To do this, position the block cursor at 
  503.      that  parameter and strike the SPACE key.   The parameter will be 
  504.      replaced with
  505.  
  506.                     "--->> Printer"
  507.  
  508.      to signify the output is being routed to the printer.
  509.           Finally,  you can use the asterisk symbol (*) in the  Active 
  510.      Output  File parameter to tell T-Ref to give the output file name 
  511.      the  same  name as the input file  name.   
  512.  
  513.      Source Lister Area
  514.  
  515.           The  source  lister  area of the driver screen  is  used  to 
  516.      select  the  options desired for a listing of the  Pascal  source 
  517.      code.   Chapter  2 of this manual is devoted to  describing  this 
  518.      area in detail.
  519.  
  520.  
  521.  
  522.  
  523.                                     1-2
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      Cross Reference Lister Area
  533.  
  534.           The cross reference lister area of the driver screen is used 
  535.      to select the options for the cross reference listing.  Chapter 3 
  536.      of this manual is devoted to describing this area in detail.
  537.  
  538.  
  539.      Function Keys:
  540.  
  541.           All  ten of the IBM PC's function keys are used by T-Ref  to 
  542.      perform  specific functions within the program.   These functions 
  543.      can be divided into five areas:  help functions, header creation, 
  544.      I/O  control,  saving  and  retrieving  parameter  settings,  and 
  545.      executing the "scanner" and "SCRIPT" programs.   In this section, 
  546.      we  discuss  the first four;  the last is covered later  in  this 
  547.      chapter.
  548.  
  549.      Pop-Up Help Functions
  550.  
  551.           There  are  three  keys that  activate  the  program's  help 
  552.      windows:   the  F1  provides  a function  key  synopsis,  the  F2
  553.      function  key  provides  text descriptions of each  of  the  main 
  554.      screen  parameters,  and the F7 key assists you in selecting  the 
  555.      source file to be cross referenced.
  556.           If  you ever wish to know what any of the function keys  do, 
  557.      the F1 key will provide a list of these functions.
  558.           The  F2  key  is  the help key for  any  of  the  parameters 
  559.      displayed  on  the main driver screen,  as well as for  the  File 
  560.      Control,  Printer Control,  and Screen Control Window parameters.  
  561.      Through the use of 'Context Sensitive' help functions,  when  the 
  562.      F2 key is struck, the help window that appears on the screen will 
  563.      provide   information  specifically  related  to  the   parameter 
  564.      selected  by  the  block cursor.   This simplifies  the  learning 
  565.      process  and requires less documentation support while using  the 
  566.      program.
  567.           The  F7  key can be a great help in searching  out  specific 
  568.      file names.  When you strike the F7 key, a special window appears 
  569.      and asks you to type in the name of the file to search.   The MS-
  570.      DOS  wildcard  characters  "*" and "?"  are  allowed  here.   The 
  571.      default  file  name extension is taken from  the  name  extension 
  572.      specified  in  the 'File Control Window' (see  Chapter  5,  "File 
  573.      Control" for more details).
  574.           Once you have typed in the file name sequence,  hit  RETURN.  
  575.      You  can then select the desired file with the arrow keys  (Left, 
  576.      Right,  Up,  and Down) or Home or End keys and,  by again hitting 
  577.      the  RETURN key,  T-Ref returns to the main screen  automatically 
  578.      loading the selected file into the "Active Input File" parameter.
  579.  
  580.      Creating Headers
  581.  
  582.           The  F3  and F4 function keys are used to  create  the  page 
  583.      headers  for  the  source  listing and  cross  reference  listing 
  584.      respectively.   Chapter  4  covers in detail the  procedures  for 
  585.      creating and activating headers for the listings.
  586.  
  587.  
  588.  
  589.                                     1-3
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      I/O Control
  599.  
  600.           As stated before,  T-Ref was designed to be flexible in  its 
  601.      control of many hardware I/O features of your system: the display 
  602.      system,  the disk file system,  and the printer device.   The F5, 
  603.      F6,  and F8 function keys provide a way to set up T-Ref to  match 
  604.      your  personal tastes,  as well as inform T-Ref of your  system's 
  605.      features.   Chapter 5 of this manual is devoted to describing how 
  606.      to set up T-Ref to respond appropriately to your system.
  607.  
  608.      Saving/Retrieving Parameter Settings
  609.  
  610.           The  F9 and F10 function keys are used to retrieve and  save 
  611.      all  of  the parameters (as they are set) from (or to)  the  file 
  612.      called 'T-REF.DB'.   This information includes all of the  driver 
  613.      screen  fields,  the source and cross reference headers,  and the 
  614.      special  settings for I/O control.   
  615.           This  version  allows  you to save only up  to  2  different 
  616.      combinations  of parameter settings.   Each combination will have 
  617.      an associated database identifier (up to eight characters  long).  
  618.      Whenever you wish to load or save the parameter settings,  you do 
  619.      so with the database identifier.
  620.           When  you  press either the F9 key (to retrieve a  different 
  621.      combination  of parameter settings) or the F10 key (to  save  the 
  622.      present  parameter  settings),  two  windows will appear  on  the 
  623.      screen.   The  window on the right will display the  various  key 
  624.      options available and a short description of each.  The window on 
  625.      the  left will list the database identifiers of all  combinations 
  626.      available  to  either  read  from or write to  depending  on  the 
  627.      function key struck.
  628.           The  save  (or  F10) function allows you to create  one  new 
  629.      entry.    Simply move the block cursor to the position below  the 
  630.      SYSTEM identifier.   A ">" symbol will then appear signifying the 
  631.      need  for  a  name.   Type in the identifier you wish to  use  in 
  632.      association with the parameter settings and hit RETURN.   At this 
  633.      point,  you have only entered the name.   Strike RETURN again and 
  634.      the combination will be saved.
  635.  
  636.  
  637.      Changing the Parameter Settings:
  638.  
  639.           T-Ref's  uniquely  designed  driver program  simplifies  the 
  640.      procedures  in  how to use it primarily because of  the  "switch-
  641.      selectable"  options  it  establishs for nearly  every  parameter 
  642.      option the program supports.   By switch-selectable, we mean that 
  643.      you  select the desired option for each parameter by placing  the 
  644.      block cursor over the parameter and striking the SPACE bar.  This 
  645.      action causes the driver to "switch" from option to option as the 
  646.      SPACE  bar  is struck.   When the desired option appears  in  the 
  647.      block  cursor,  you  are  through.   This  eliminates  having  to 
  648.      remember  complex  or symbolic keystroke sequences  to  bring  up 
  649.      desired options.   By simply knowing how to move the block cursor 
  650.      about  the screen (with the arrow keys,  primarily) and that  the 
  651.      SPACE  bar  is used to set the parameters,  you have learned  the 
  652.      most complex part of the program!
  653.  
  654.  
  655.                                     1-4
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.      Exiting T-Ref:
  666.  
  667.           To exit the driver shell program, simply strike the ESC key.  
  668.      A window will appear asking if you are sure you wish to quit  the 
  669.      program.  If you do wish to quit, respond with a "Y".
  670.           T-Ref  also tracks on updates to any of the parameters since 
  671.      the  last time the parameter settings were saved to the  database 
  672.      file.   If  you have updated any of them,  it will warn you  that 
  673.      changes  have  occurred,  and will ask if you wish  to  save  the 
  674.      present parameter settings.
  675.  
  676.  
  677.      Executing the "Scanner" Program:
  678.  
  679.           The key combination ALT-F9 together will cause the  "Driver" 
  680.      program  to  load  the "Scanner" program into  memory  and  begin 
  681.      scanning  the file specified in the "Active Input File" parameter 
  682.      at the top of the driver screen.   
  683.  
  684.  
  685.      The Scanner Window:
  686.  
  687.           The scanner window is divided into four areas:  the  source 
  688.      files area,  the XREF files area, the messages area, and the free 
  689.      memory area.  These are described below.
  690.  
  691.      Source Files Area
  692.  
  693.           The  top  third  of the window is the Source File  area  and 
  694.      contains  three fields:  the input file name,  the  include  file 
  695.      name,  and the output file name.  These fields are updated by the 
  696.      scanner  as needed.   The numbers that appear to the left of  the 
  697.      first  two as the scanning process occurs are the line numbers of 
  698.      the source code as they are read from the input files.
  699.  
  700.      XREF Files Area
  701.  
  702.           The middle of the window is the XREF Files  area.   However, 
  703.      because  the  shareware  version of T-Ref does not  support  XREF 
  704.      files,  this  area  will always be inactive.   See Chapter 7  for 
  705.      details on what XREF files are.
  706.  
  707.      Message Area
  708.  
  709.           The message area is used to provide status information about 
  710.      the progress of the scanning.   If an error is encountered in the 
  711.      syntax  of the input file,  the message describing the  error  is 
  712.      printed  within  this area.   This area is also used  to  display 
  713.      final  results  of  the output (number of  lines  read/number  of 
  714.      identifiers  cross referenced),  as well as to receive  responses 
  715.      from the user about T-Ref generated questions.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                    1-5 
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      Memory Free Display
  731.  
  732.           At  the  bottom of the scanner window will appear a  "Memory 
  733.      Free"  message  that  gets  updated  regularly  as  the  scanning 
  734.      progresses.    This  signifies  the  amount  of  dynamic   memory 
  735.      remaining (in bytes) T-Ref has available for use.   If this value 
  736.      should  drop  below 1000 bytes,  the scanner will abort the  scan 
  737.      process as it has no more memory to save information.   
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.                                     1-6
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                        Chapter 2 - The Source Lister
  797.  
  798.  
  799.      Activating the Source Lister:
  800.  
  801.           The  Source Listing program is activated by positioning  the 
  802.      block  cursor over the 'Source Listing' parameter,  and  striking 
  803.      the  SPACE bar until either the word "Continuous" or "Procedural" 
  804.      appears within the cursor.   To deactivate the source lister, hit 
  805.      the SPACE bar until the word "OFF" appears.   Where  "Continuous" 
  806.      sends  the  source listing in a continuous  stream,  "Procedural" 
  807.      performs  page  breaks  at the conclusion of  each  procedure  or 
  808.      function.
  809.  
  810.  
  811.      Parameter Options:
  812.  
  813.           The  fifteen parameters that appear on the screen below  the 
  814.      'Source  Listing' parameter relate to specific information to  be 
  815.      included  or not included in the source listing.   They  are  all 
  816.      updated in the same manner as the 'Source Listing' parameter:  by 
  817.      placing  the  block  cursor over the parameter and  striking  the 
  818.      SPACE  bar  until  the desired value appears  within  the  cursor 
  819.      block.   
  820.  
  821.  
  822.      Reserved Words and Identifiers:
  823.  
  824.           The 'Reserved Words' parameters are used to tell the program 
  825.      how the reserved words are to be formatted to the output.  In the 
  826.      first field,  you specify one of four different formats:  "UPPER" 
  827.      capitalizes  all letters in the reserve word,  "LOWER" prints  in 
  828.      lower-case lettering,  "FORML" follows formal naming conventions, 
  829.      and "AS IS" prints the letters unchanged.  Figure 2-1 below gives 
  830.      examples of different reserved words and how the output would  be 
  831.      formatted;  the  first column is how the reserved words would  be 
  832.      hypothetically read from the input source file.
  833.           In the second field, you specify whether special emphasizing 
  834.      is  to  be  used  when sending the source listing  to  a  printer 
  835.      device.   "ULine"  causes  all reserve words  to  be  underlined; 
  836.      "DStrike"  embolds  the  reserve  words by  double  striking  the 
  837.      characters;  "Dbl&ULn"  will force the printer to do both  double 
  838.      strike and underline reserve words;  and finally "Off" turns  off 
  839.      the emphasizing function.
  840.           The  embolding  option is only available when the output  is 
  841.      directed to the printer.  
  842.  
  843.           The  'Identifiers'  parameter's function is similar  to  the 
  844.      'Reserved  Words'  parameter's described above:  it  formats  the 
  845.      style  of lettering for all identifiers to that  requested.   The 
  846.      same  four formatting styles listed above are available for  this 
  847.      parameter.   However,  here  we  must describe a feature  of  the 
  848.      "FORML"  format  not mentioned above.   Since  the  Turbo  Pascal 
  849.      compiler  allows  the use of the underline symbol (_)  within  an 
  850.      identifier  (to make the source code more readable),  the "FORML" 
  851.  
  852.  
  853.                                     2-1
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.      style  makes  use of this:  not only is the first letter  in  the 
  864.      identifier capitalized,  but each letter following the  underline 
  865.      symbol  is capitalized as well.   Therefore,  'hot_item'  becomes 
  866.      'Hot_Item',     'not_so_fast'    becomes    'Not_So_Fast',    and 
  867.      'ab_ra_ca_da_bra' becomes 'Ab_Ra_Ca_Da_Bra'.
  868.  
  869.  
  870.      Line Numbering:
  871.  
  872.           The 'Line Numbering" parameter provides several various ways 
  873.      to  number the source code,  printed to the left of each line  of 
  874.      output: "Extended", "Relative", and "Procedural".
  875.           "Extended"   line  numbering  presents  a  one-column   line 
  876.      counter,  where each line of source increments the counter.  This 
  877.      is the simplist style of numbering, and does not take into effect 
  878.      whether  the  source code is coming from the main input  file  or 
  879.      from  an Include file.   
  880.           "Relative" line numbering is a two-column line counter.  The 
  881.      first  column  is the line number of the "main" input  file;  the 
  882.      second column is the Include file line number.  That is, the line 
  883.      numbering is relative to the file the source is coming from.  The 
  884.      line  number of the main input file is incremented for each  line 
  885.      read from the 'Active Input File' as specified at the top of  the 
  886.      main  screen.   When an include file compiler directive,  such as 
  887.      '{$i this.prc}', is scanned from the main input file, the program 
  888.      will  begin  printing  the  include  file  source  code  starting 
  889.      immediately  after  printing the line in which the  include  file 
  890.      compiler  directive is on.   At this point (until the end of  the 
  891.      include file is reached),  the line number of the main input file 
  892.      will remain the same and the line number of the include file will 
  893.      begin incrementing in the second column (starting from  1).   The 
  894.      line  number of the include file is not printed when the  program 
  895.      is reading from the main input file.
  896.           "Procedural"  line  numbering  is  also  a  two-column  line 
  897.      counter.   The  first  column  is  the  same  as  the  "Extended" 
  898.      numbering  (see above);  and the second column is the line number 
  899.      within the active procedure.  As a new procedure/function decla-
  900.      ration begins, the second line counter resets and begins counting 
  901.      from 1 again.   However,  when the procedure/function declaration 
  902.      is  complete,  the  line  numbering  reverts  back  to  the  line 
  903.      numbering counter of the encompassing procedure/function.
  904.  
  905.  
  906.      Lexical Level Numbering:
  907.  
  908.           The 'Lexical Levels' parameter,  when activated ("ON"), will 
  909.      print  for each source line a value representing the lexical,  or 
  910.      procedural,  depth  of the program.   Therefore,  as the  program 
  911.      scans the beginning of a procedure or function, the lexical level 
  912.      of the program is incremented;  the level is decremented when the 
  913.      procedure or function is exited.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.                                     2-2
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      Block Level Numbering:
  929.  
  930.           The 'Block Levels' parameter,  when activated  ("ON"),  will 
  931.      print  a value representing the structured statement depth within 
  932.      the procedure or function being scanned.  The value is printed on 
  933.      each line of the output.   Whenever a structured statement (e.g., 
  934.      the IF,  the FOR,  the REPEAT,  the CASE, the WITH, the WHILE, or 
  935.      the  compound BEGIN-END statement) is entered during the scan  of 
  936.      the source code, the block depth of the procedure is incremented, 
  937.      and is decremented upon exiting the structured statement.  
  938.  
  939.  
  940.      Block Diagramming:
  941.  
  942.           In addition to the lexical and block level numbering for the 
  943.      source lister,  this version provides the capabilities to diagram 
  944.      the blocking outlines of the source code.   Similar to the  block 
  945.      numbering,  this is a graphical representation of the code blocks 
  946.      rather than a numeric one.
  947.           Up to eight levels of blocks can be shown for each procedure 
  948.      or function.   If the code extends beyond eight levels,  only the 
  949.      first eight are blocked.
  950.           Only  specific  statements activate a diagram  block  level.  
  951.      These include the compound statement (a BEGIN ..  END block), the 
  952.      IF statements, the CASE statement, and the REPEAT .. UNTIL block.  
  953.      The  WITH,  the  WHILE,  and the FOR statements are  designed  to 
  954.      assume  there  is only a single substatement.   If more than  one 
  955.      statement  is  to be acted upon,  a compound  statement  must  be 
  956.      given, thereby activating a diagram block.
  957.  
  958.  
  959.      Auto-Commenting:
  960.  
  961.           One  of  T-Ref's  unique  features  is  its  auto-commenting 
  962.      capability.   Pascal  has been recognized in the recent past  for 
  963.      its  ineffective  ability to mark its END reserved word with  the 
  964.      statement  that  initiated the block the  END  goes  with.   More 
  965.      recent languages such as Ada and Modula-2 correct this problem to 
  966.      some  degree  by requiring that each END be supplimented with  an 
  967.      additional  reserved  word (or identifier)  matching  that  which 
  968.      beget  the  compound  structure.   There is  often  nothing  more 
  969.      unnerving  to  a programmer reading source code to  get  confused 
  970.      over which END symbol goes with which structured statement.
  971.           T-Ref  can  help  to some degree  with  its  auto-commenting 
  972.      feature.   As  T-Ref  produces the source listing,  if the  auto-
  973.      commenter is "On", it will automatically generate a comment after 
  974.      each  END symbol it encounters to signify the structure  type  it 
  975.      goes with.
  976.           The comments always begin with the symbols "{#" and end with 
  977.      the  symbols "#},  and recognizes these symbol sequences as T-Ref 
  978.      generated comments when scanned from the input source file.
  979.           Note: When the auto-commenter is activated, T-Ref will auto-
  980.      matically  eliminate all commented code placed between  the  "{#" 
  981.      and "#}" symbols (while generating new comments).   Therefore, do 
  982.      not use these symbols to start and end your comment blocks.
  983.  
  984.  
  985.                                     2-3
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.      Active Procedure/Function Fields:
  997.  
  998.           The  first 'Active Procedures' parameter field,  when  acti-
  999.      vated  ("ON"),  will print the name of the procedure or  function 
  1000.      (presently being scanned) to the right of the output source code.  
  1001.      The  name  is  enclosed  in brackets (between  '{'  and  '}')  to 
  1002.      increase  the documentation effects of the source and to make  it 
  1003.      possible to recompile the output source.
  1004.           The second parameter field is the column width field,  which 
  1005.      sets  the number of columns the program will read from the source 
  1006.      (input)  file.   The range may be from 20 columns to 126  columns 
  1007.      (which  is  the limitation set by the Turbo  editor).   When  the 
  1008.      first field is set to "Off", this value is completely ignored and 
  1009.      the  entire source line (up to 126 columns) is read and  scanned.  
  1010.      However,  when  the first field is set to "On",  any text on  the 
  1011.      input source code lines beyond the specified column setting  will 
  1012.      be  ignored by the scanner and will not be printed.   Figure  2-5 
  1013.      below demonstrates this output.
  1014.  
  1015.           Note:  The  column  width setting also defines  the  maximum 
  1016.      column  in  the cross reference listing  format.   That  is,  the 
  1017.      number  of line references printed per line is determined by this 
  1018.      value.
  1019.  
  1020.  
  1021.      Header Markers:
  1022.  
  1023.           Header markers are score marker lines printed at the top and 
  1024.      the bottom of each page of source code and are used to  determine 
  1025.      column positioning of source code.   
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.                                     2-4
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                   Chapter 3 - The Cross Reference Lister
  1061.  
  1062.  
  1063.  
  1064.      Activating the Reference Lister:
  1065.  
  1066.           The  Cross Reference Lister is activated by positioning  the 
  1067.      block  cursor over the 'Cross Reference' parameter  and  striking 
  1068.      the  SPACE  bar until either the word "Comprehensive" or  "Proce-
  1069.      dural"  appears within the cursor  block.   When  activated,  the 
  1070.      lister  gives a cross reference listing of the specified types of 
  1071.      identifiers and/or additional details such as a procedural  table 
  1072.      of  contents  and  analysis on the code  scanned.   Selection  of 
  1073.      identifiers is determined by object type as described below.
  1074.           To deactivate the cross reference lister,  hit the SPACE bar 
  1075.      until the word "Off" appears.   Note that the same procedure here 
  1076.      is  used to activate the cross reference lister as in the  source 
  1077.      lister described in Chapter 2 above.  Like the source lister, the 
  1078.      parameters  that appear on the screen directly below  the  'Cross 
  1079.      Reference' parameter relate to what information is to be included 
  1080.      in  the  cross reference listing,  as well as setting  a  header, 
  1081.      paging,  and  including  Include  Files.   These  parameters  are 
  1082.      updated  in  the  same manner as those parameters in  the  source 
  1083.      lister area:  by placing the block cursor over the parameter  and 
  1084.      striking the SPACE bar until the desired parameter appears within 
  1085.      the cursor.
  1086.           With  the  "Comprehensive"  option,  T-Ref waits  until  the 
  1087.      entire  source  code has been scanned before printing  the  cross 
  1088.      reference listing;  that is, it is comprehensive.  However, there 
  1089.      are times when in scanning a very large unit, there is not enough 
  1090.      computer  memory available to hold all related cross  referencing 
  1091.      information until the entire unit or program has been scanned.
  1092.           The  "Procedural"  option has the advantage  of  having  the 
  1093.      cross  referencing data grouped into packages consistent with the 
  1094.      source.   Identifier reference listings can be, therefore, easier 
  1095.      to  follow.   With  this option,  a cross  reference  listing  is 
  1096.      printed at the exit of every procedure or function,  and includes 
  1097.      only those identifiers declared local to that procedure.  Since a 
  1098.      procedure's   local  identifiers  have  scopes  only  while   the 
  1099.      procedure declaring it is "active",  all references will occur by 
  1100.      the closure of the procedure's declaration.  Once the identifiers 
  1101.      and  their references have been printed,  memory can be  released 
  1102.      for  later  use  by other declarations further on in  the  source 
  1103.      listing.
  1104.  
  1105.  
  1106.      Detail Level:
  1107.  
  1108.           With  T-Ref  4.0,  it  is possible to select  one  of  three 
  1109.      different levels of detail for the cross reference listing.   For 
  1110.      the numbering scheme, "1" is the most abridged listing, providing 
  1111.      only  the bare minimum of information about the  identifiers  and 
  1112.      listing  their references;  while "3" is the most  comprehensive.  
  1113.      See the section below on what is listed for each level.
  1114.  
  1115.  
  1116.  
  1117.                                     3-1
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.      Object Selection:
  1127.  
  1128.           The second through sixth parameters below the "Cross  Refer-
  1129.      encer"  header  are the five object categories T-Ref  recognizes. 
  1130.      (See  Appendix A,  "Definitions" for descriptions of  the  object 
  1131.      types).   Each  of these object categories have two  fields:  the 
  1132.      scope  and usage fields.   
  1133.           The scope field is used to determine the selection of ident-
  1134.      ifiers  based  upon whether they are declared within the  scanned 
  1135.      program  or unit ("Local").   The "All" setting acts just as  the 
  1136.      "Local"  setting  does.   The  "None" setting skips  listing  any 
  1137.      identifier of that object category.
  1138.           In  addition  to these options,  local  identifiers  may  be 
  1139.      further broken into local public and local private.  The "LclPbl" 
  1140.      selects  only the identifiers of that type that are local public; 
  1141.      the "LclPvt" selects only those that are local private.
  1142.           The  commercial  version of T-Ref  supports  the  additional 
  1143.      option "Remote", which selects only those identifiers declared in 
  1144.      other  units  that  the scanned unit or program  USES  (imports).  
  1145.      Since  this version does not support XREF files,  this option  is 
  1146.      not included.
  1147.           The  usage parameter is used to determine the  selection  of 
  1148.      identifiers  based upon whether or not they have been  referenced 
  1149.      within  the  program  (other than in  their  declarations).   The 
  1150.      "Used"  setting will select for listing only identifiers of  that 
  1151.      object  type  that were actually used within  the  program.   The 
  1152.      "Unused"  setting selects only those identifiers  not  referenced 
  1153.      anywhere within its scope.  The "All" setting selects identifiers 
  1154.      declared of that object type irregardless of their use.
  1155.  
  1156.  
  1157.      Scan Within Conditional Compilation:
  1158.  
  1159.           This  option is inactive for the shareware  version.   T-Ref 
  1160.      will always scan in conditional code segments.
  1161.  
  1162.  
  1163.      Procedural Table Listing:
  1164.  
  1165.           T-Ref,  in addition to the identifier listing,  provides the 
  1166.      option  to print a procedural table of contents of all the proce-
  1167.      dures  and  functions declared within the  scanning,  along  with 
  1168.      their  declaration page and line numbers as well as  the  lexical 
  1169.      level  number of the procedure.   This portion of the listing  is 
  1170.      excellent  for getting a general layout of a program,  unit ,  or 
  1171.      library.  The names are indented according to the lexical (proce-
  1172.      dural)  level,   and  external  procedures/functions  are  noted.  
  1173.      Finally,  each procedure/function in the listing will have a file 
  1174.      number reference.   In a separate listing that follows the proce-
  1175.      dural mapping, a list of source file names, dates, and times used 
  1176.      in the scanning is printed.   File dates and times are  retrieved 
  1177.      from  the DOS file date/time tag of the file's last update.   The 
  1178.      file  number reference matches that in the procedural  map,  thus 
  1179.      correlating  each  procedure to the source file  it  is  declared 
  1180.      within.
  1181.  
  1182.  
  1183.                                     3-2
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.           The  file  to  procedure association will  help  to  quickly 
  1193.      locate  the  include  files procedures are  declared  within.  In 
  1194.      addition,  the dates can be used to determine the latest date  of 
  1195.      modification to the source code scanned by T-Ref.
  1196.  
  1197.  
  1198.      Code Analysis:
  1199.  
  1200.           Finally,  the  cross reference lister can print an  analysis 
  1201.      summation  about  the source scanned and the identifiers  listed.  
  1202.      This analysis includes five areas: a structured statements count, 
  1203.      a  commented percentages count,  the total number of  identifiers 
  1204.      cross referenced,  a break-out of the identifier count by  object 
  1205.      type and data type, and an identifier usage count. 
  1206.           The  structured  statements count lists the number  of  each 
  1207.      structured  statement  types encountered during the  scan,  which 
  1208.      includes IF,  FOR, CASE, WHILE, REPEAT, and GOTO statements.  The 
  1209.      commented  percentages  gives a text ratio of commented  text  to 
  1210.      code text.  In this count, blank characters are not counted.  The 
  1211.      identifier  usage  count lists the number of  identifiers  LISTED 
  1212.      based on the number of times they were referenced.
  1213.           Note:  Untyped formal parameter, label, procedure, unit, and 
  1214.      program  names  have  no  data  type  associated  with  them  and 
  1215.      therefore will not be included in the data type totals. 
  1216.  
  1217.  
  1218.      Undeclared Identifiers:
  1219.  
  1220.           This  parameter  allows  you to control whether  or  not  to 
  1221.      include  identifiers  in the listing that  were  never  declared.  
  1222.      Such  identifiers occur when scanning an Include File that refer-
  1223.      ences identifiers within its scope,  but whose declarations occur 
  1224.      outside  the source's domain;  or when scanning a unit that  uses 
  1225.      other  units  and their identifiers,  but whose XREF  files  were 
  1226.      never loaded.
  1227.  
  1228.  
  1229.      Interpreting the Reference listing:
  1230.  
  1231.  
  1232.           This  section  provides a detailed look  at  the  identifier 
  1233.      reference  listing,  and is designed to familiarize you with  the 
  1234.      formats and symbols used.
  1235.  
  1236.      Formats
  1237.  
  1238.           As described in the section on "Detail Levels" above,  there 
  1239.      are five levels of detail in the cross reference listing.  Detail 
  1240.      level  "1"  is the lowest and provides only  minimal  information 
  1241.      about  the identifiers,  focusing primarily on providing a way to 
  1242.      distinguish  between identifiers with the same name  and  listing 
  1243.      where they are used.   As the formats go toward "3", more details 
  1244.      are  provided.   The  following  are the formats of each  of  the 
  1245.      detail levels.
  1246.  
  1247.  
  1248.  
  1249.                                     3-3
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.           The  identifier listing header is the first lines  for  each 
  1259.      identifier in the listing.
  1260.  
  1261.      Level 1:
  1262.  
  1263.           Name                               LLLL:SSSS . . .
  1264.  
  1265.      Level 2:
  1266.  
  1267.           Name  Object_Type   Data_Type  Declared on line LLLL:SSSS  
  1268.                          [Unit = Unit_Name]
  1269.  
  1270.      Level 3:
  1271.           Name  Object_Type   Data_Type  Declared on line LLLL:SSSS 
  1272.                          within Proc_Name (Lvl) [Unit = Unit_Name]
  1273.  
  1274.      where  Name  is the name of the identifier (up to  20  characters 
  1275.      long),  Object_Type  is  its object type,  Data_Type is its  data 
  1276.      type,  LLLL:SSSS  is  the line number (and possibly  the  subline 
  1277.      number) of the declaration,  Proc_Name is the procedure or  func-
  1278.      tion  name that the identifier is declared within (up to 20 char-
  1279.      acters long),  Lvl is the lexical level of the procedure or func-
  1280.      tion  within the scanned code.   (The "System" level  is  lexical 
  1281.      level zero, the program level is 1, and so on.)  Unit_Name is the 
  1282.      declaration unit's name (if different from the one being scanned) 
  1283.      and File_Name is the name of the file the declaration occurred in 
  1284.      (if different from the main source file).
  1285.  
  1286.           At levels 2 and 3,  after the identifier's header, the lines 
  1287.      that follow are the references to the identifier.  The format is:
  1288.  
  1289.      LLLL:SSSS    LLLL:SSSS    LLLL:SSSS    .....
  1290.  
  1291.  
  1292.           If  an  identifier is listed in the cross reference  listing 
  1293.      but has no references,  the following is printed rather than  the 
  1294.      line references:
  1295.  
  1296.           <<< Identifier not referenced. >>>
  1297.  
  1298.           Each  reference line number may be preceeded by one of  four 
  1299.      symbols,  which signify that the identifier was set to a specific 
  1300.      value.  These are the "*", "&", "L", and "C".
  1301.  
  1302.           "*"  means the identifier was explicitly set to a  value  on 
  1303.      that  line of code.
  1304.           "&"  means the same as "*",  except that the identifier  was 
  1305.      set at a lexical (procedural) level BELOW the level of its decla-
  1306.      ration.   This  second  symbol could mean that you are setting  a 
  1307.      variable within a procedure that is not supposed to change it.  
  1308.           "L"  is used to signify that the variable is set as  a  Loop 
  1309.      counter.
  1310.           "C"  signifies where a variable is set through a call  to  a 
  1311.      procedure  or  function and the variable matches the  procedure's 
  1312.      parameter sequence as a "Variable Formal Parameter".  
  1313.  
  1314.  
  1315.                                     3-4
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.           NOTE:  T-Ref  MUST know the declaration of the procedure  or 
  1325.      function  being  called with the variable's formal  reference  to 
  1326.      know  whether it is being set (by matching the reference  with  a 
  1327.      variable formal parameter).  If the procedure's declaration is in 
  1328.      another  unit,  for example,  T-Ref has no way of knowing whether 
  1329.      the reference is by name or value,  and thus no symbol will  show 
  1330.      up.  T-Ref, in such cases, will always assume the reference is by 
  1331.      value.
  1332.  
  1333.           'Explicitly set' means that the variable or function was set 
  1334.      with a "Variable := <<Expression>>" statement,  and does not take 
  1335.      into  consideration  setting the identifier through  the  use  of 
  1336.      procedure or function parameter passing.
  1337.  
  1338.           If  the  identifier was not declared within the source  code 
  1339.      (as is the case when cross referencing a portion of a program  or 
  1340.      a  library  or  procedures that reference  identifiers  in  other 
  1341.      portions  of the program),  then the reference number line rather 
  1342.      reads:
  1343.  
  1344.            "Not declared within the scanned source."
  1345.  
  1346.      Symbols
  1347.  
  1348.           The object type field will be one of the following:
  1349.  
  1350.           "Undefnd"-          Undefined (Not declared within the
  1351.                               parsed code)
  1352.           "Label" -           Labels 
  1353.           "Constnt" -         Constants
  1354.           "ScalVal" -         Scalar Values 
  1355.           "Typed C" -         Typed Constants
  1356.           "Type" -            Types
  1357.           "Var" -                Variables
  1358.           "FrmParm" -         Formal Parameters (considered a Variable)
  1359.           "VarParm" -         Variable Formal Parameters (considered
  1360.                               a Variable)
  1361.           "Rec Fld" -         Record Fields
  1362.           "Rec Tag" -         Record Fields declared as Record Tags
  1363.           "Program" -         Program name
  1364.           "Procedr" -         Procedures
  1365.           "Functn" -          Functions
  1366.  
  1367.  
  1368.           The data type field will be one of the following:
  1369.  
  1370.           "Undefnd" -         Undefined
  1371.           "Integer" -         Integer scalars
  1372.           "Sht Int" -         Short Integer scalars
  1373.           "Lng Int" -         Long Integer scalars
  1374.           "Byte" -            Byte scalars
  1375.           "Word" -            Word scalars
  1376.           "Real" -            Real scalars
  1377.           "Single" -          Single Precision Real
  1378.           "Double" -          Double Precision Real
  1379.  
  1380.  
  1381.                                     3-5
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.           "Extnded" -         Extended Real
  1391.           "Comp" -            Comp Real 
  1392.           "Boolean" -         Boolean scalars
  1393.           "String" -          String scalars
  1394.           "Char" -            Character scalars
  1395.           "Scalar" -          User Defined Scalars
  1396.           "Pointer" -         Pointer Type
  1397.           "Range" -           Subranges
  1398.           "Record" -          Structured Type Records
  1399.           "Proced" -          Procedural Type
  1400.  
  1401.      and  may  be  preceeded by some combination of the  following  to 
  1402.      signify a structured data type:
  1403.  
  1404.           "Absolute Addr" -   The Variable is located at a specific 
  1405.                               address in memory 
  1406.           "Pointer to" -      The Type or Variable is of type Pointer
  1407.           "File of" -         The Type or Variable is of type File
  1408.           "Set of" -          The Constant, Type, or Variable 
  1409.                               is of type Set
  1410.  
  1411.           For  example,  "Absolute Addr Set of Scalar" means the  data 
  1412.      type  of  the  identifier is a set of type scalar  and  is  at  a 
  1413.      specific address in memory.
  1414.  
  1415.  
  1416.      "Hardwired" Identifiers:
  1417.  
  1418.           Although  the  standard  TYPE identifiers such  as  BOOLEAN, 
  1419.      INTEGER,  and  REAL  are  part  of  the  SYSTEM.TPU  unit,  T-Ref 
  1420.      considers  these  identifiers "wired" into the  compiler  itself.  
  1421.      Such  identifiers are part of the language's  foundation.   Thus, 
  1422.      you will never get a "listing" with these identifiers in them.
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.                                     3-6
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                         Chapter 4 - Common Features
  1457.  
  1458.           This  chapter  highlights the features T-Ref possesses  that 
  1459.      were not discussed in the previous two chapters but whose  param-
  1460.      eters  option are visible on the main screen.  These features are 
  1461.      common to both the source lister and the cross reference  lister.
  1462.  
  1463.  
  1464.      Handling Include Files:
  1465.  
  1466.           T-Ref  offers  a unique and flexible way of  handling  Turbo 
  1467.      Pascal  include files when these compiler directives are  encoun-
  1468.      tered  in the input source code.   The 'Read Include File' param-
  1469.      eter for the source listing informs the program whether or not to 
  1470.      list  the  source  code of the external  files  (included  during 
  1471.      compilation through an include file compiler directive) with  the 
  1472.      main  source  code.   When activated ("YES"),  include files  are 
  1473.      automatically placed into the output's source listing immediately 
  1474.      after  the  source  line containing  the  include  file  compiler 
  1475.      directive is printed.   Besides the "YES" and "NO" options, there 
  1476.      is  an  OPTIONAL setting ("OPT") which allows you to  selectively 
  1477.      decide which include files are to be printed.   When this setting 
  1478.      is selected, a message is sent to the message area of the Scanner 
  1479.      screen every time an include file compiler directive is  scanned, 
  1480.      asking  whether  or not the file is to be included in the  source 
  1481.      listing.   Responding "Y"es will route the include file source to 
  1482.      the output; "N"o will cause the include file source listing to be 
  1483.      skipped.
  1484.           The  'Read Include File' parameter for the  cross  reference 
  1485.      lister  is  used  to tell the program whether or not  to  include 
  1486.      external  source  files in the  cross  reference  listing.   When 
  1487.      activated  ("Yes"),  include  files are automatically parsed  for 
  1488.      cross referencing identifiers within the files (declarations  and 
  1489.      uses)  based  on the object type settings of the cross  reference 
  1490.      parameters.   The  OPTIONAL setting ("Opt") allows you to  selec-
  1491.      tively  choose the files to be included in the cross  referencing 
  1492.      process.
  1493.  
  1494.  
  1495.      Defining Listing Headers:
  1496.  
  1497.           To further enhance the source and cross reference  listings, 
  1498.      the program implements powerful page header options.  Rather than 
  1499.      defining  the  header  within the source code,  the  headers  are 
  1500.      created  using  special pop-up windows.   The source  lister  and 
  1501.      cross reference lister each have their own header windows.
  1502.           The 'Header' parameters for both the source listing and  the 
  1503.      cross reference listing are handled in precisely the same manner.  
  1504.      These  parameters,  when  activated ("ON"),  print a preset  text 
  1505.      header at the top of each page of output (either source or  cross 
  1506.      reference,  respectively).   The header is from one to five lines 
  1507.      and  each line can be up to 75 columns in length.   The F3 and F4 
  1508.      function keys are used to set up the header text.
  1509.  
  1510.  
  1511.  
  1512.  
  1513.                                     4-1
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.      Creating Headers
  1523.  
  1524.           By  striking  the  F3 function key (for the  source  listing 
  1525.      header)  or the F4 function key (for the cross reference  listing 
  1526.      header),  a window will appear on the screen,  giving the present 
  1527.      header  line  size and asking if you wish to  change  it.   After 
  1528.      responding  with the number of lines for the header (from 1 to  5 
  1529.      lines),  or  by  entering RETURN to keep  the  same  number,  the 
  1530.      program will display two windows.   The window on the bottom will 
  1531.      show  all key options available in the header window;  the one on 
  1532.      the  top is the text editor window,  used to type in  the  header 
  1533.      format.
  1534.           It  is  possible to add information into  the  header  dyna-
  1535.      mically.   That is file name,  page number,  and present date and 
  1536.      time strings can be inserted directly into the header.  Thus, you 
  1537.      can  create  your own page numbering layout if you wish  to  have 
  1538.      page  numbering at the top of the page rather than at the  bottom 
  1539.      with the page numbering T-Ref provides.
  1540.           Note:  If 0 (zero) is entered as the number of lines,  it in 
  1541.      effect eliminates printing the header without actually destroying 
  1542.      the text within the header itself.  In this case, the text editor 
  1543.      window will not appear.
  1544.  
  1545.      Activating Headers
  1546.  
  1547.           To  activate  printing the headers,  simply move  the  block 
  1548.      cursor  to  the appropriate 'Header' field and set it to "On"  by 
  1549.      striking  the SPACE bar.   There is a 'Header' field within  both 
  1550.      the source listing and the cross reference listing areas.
  1551.           When  headers are active,  the top margin setting  is  still 
  1552.      used  to determine the spacing at the top of the page before  the 
  1553.      header  is  printed.   However,  when a header  is  printed,  the 
  1554.      program  will  automatically  buffer two blank  lines  after  the 
  1555.      header  (before  the next line of source code or cross  reference 
  1556.      listing information), so it is not necessary to buffer the header 
  1557.      with blank lines within the header itself.
  1558.  
  1559.  
  1560.      Page Numbering:
  1561.  
  1562.           The 'Page Numbering' parameters will, when activated ("ON"), 
  1563.      automatically  number the pages of the output source (whether  it 
  1564.      is  going to a file or to the printer).  A date/time  tag  (which 
  1565.      comes  from  reading  the system clock for the present  date  and 
  1566.      time)  is also printed on the page number line,  along  with  the 
  1567.      name of the main source file.
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.                                     4-2
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.                      Chapter 5 - I/O Control Features
  1589.  
  1590.  
  1591.           In  addition  to  the many parameters visible  on  the  main 
  1592.      screen,  there are a number of others available through the func-
  1593.      tion  keys and are used to set various system options,  primarily 
  1594.      dealing  with  controlling  the  computer's  Input/Output.   This 
  1595.      chapter details some of the features of T-REF, version 5.0, added 
  1596.      to make it more flexible and easier to use. More precisely, these 
  1597.      features are the parameters dealing with the screen (F5 key), the 
  1598.      printer (F6 key), and the file input/output (F8 key).
  1599.           The  F2  context-sensitive help function is  supported  with 
  1600.      these  three  windows.   You  can get a synopsis of each  of  the 
  1601.      fields by bringing up any of the windows, placing the cursor over 
  1602.      one of the fields, and striking the F2 key.
  1603.  
  1604.  
  1605.      Screen Control:
  1606.  
  1607.           Several  parameters have been added to T-REF so that various 
  1608.      aspects  of  the color display screen may  be  controlled.   This 
  1609.      allows you to set the colors that are pleasing to your eyes.   In 
  1610.      addition, for those users that have color graphics boards (CGA or 
  1611.      EGA)  running with monochrome displays,  you may wish to set  the 
  1612.      color options to all black and white screens,  since T-Ref has no 
  1613.      way of knowing what form of monitor is attached (only the display 
  1614.      mode).
  1615.           These parameters are displayed and changed by first striking 
  1616.      the  F5  function key.   Since these options  only  effect  color 
  1617.      display systems, if you have a monochrome system or an EGA system 
  1618.      running in monochrome mode, these options are not available.
  1619.  
  1620.      CGA Snow
  1621.  
  1622.           If  you  have a CGA board that produces snow  during  direct 
  1623.      screen writes,  set this parameter to "Yes" by striking the SPACE 
  1624.      bar until it appears in the block cursor.  If your board does not 
  1625.      create snow,  set it to "No".  If you do not know if your monitor 
  1626.      creates  snow,  you can test your system by setting the parameter 
  1627.      to  "???" and striking the RETURN key.   A few second  test  will 
  1628.      begin  in which characters are written to the screen.   If you do 
  1629.      not  see snow before the beep (indicating the end of  the  test), 
  1630.      your  system does not produce snow.   You can then set the param-
  1631.      eter  to the appropriate setting.   You cannot exit this  feature 
  1632.      while this parameter is set to the test mode ("???").
  1633.  
  1634.      Color Selectors
  1635.  
  1636.           The  remaining parameters are used to specify colors to  be 
  1637.      used by T-REF for both the main screen and for all windows.   The 
  1638.      main screen foreground and background colors are the colors to be 
  1639.      used  on the main T-REF screen.   The Exit Frame Color is used to 
  1640.      specify  the color of the CGA/EGA/VGA frame area upon exiting  T-
  1641.      Ref.   When  the  Exit Frame Color is  Black,  it  also  prevents 
  1642.      setting the frame color upon start-up of the program.
  1643.  
  1644.  
  1645.                                     5-1
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.           The  remaining six parameters define the colors for the pop-
  1655.      up  windows that are created when the function keys are  pressed.  
  1656.      The frame is the border around the window; the title is the title 
  1657.      given to the window; and the text is the area inside the window.
  1658.  
  1659.  
  1660.      Printer Control:
  1661.  
  1662.           The  printer  control feature (brought up with the  F6  key) 
  1663.      provides several important options to control the printer.
  1664.  
  1665.      Printer Port
  1666.  
  1667.           The first selects the printer port, which can be LPT1, LPT2, 
  1668.      LPT3,  COM1,  or COM2.   The LPT ports are the line printer ports 
  1669.      (parallel  ports 1,  2,  and 3),  while the COM ports are  serial 
  1670.      ports 1 and 2.   In almost all cases, you should be using "LPT1".  
  1671.      However,  some printers may be configured to other computer ports 
  1672.      on the computer.
  1673.           When one of the parallel (LPT) ports is selected, T-Ref will 
  1674.      check the printer device port for a ready signal for each line of 
  1675.      text  sent  to the printer.   If it ever receives a  "not  ready" 
  1676.      response,  it will generate an error.   The COM printer ports are 
  1677.      NOT tested for "ready" signals like the LPT ports.  The output is 
  1678.      shipped to the port byte by byte.
  1679.  
  1680.      Lines Per Page
  1681.  
  1682.           The  second parameter sets the number of lines per page  for 
  1683.      both  the  source lister and the cross reference  lister  output.  
  1684.      The page length is set to a default value of 66 (which is  normal 
  1685.      for  most  printers using 11 inch paper lengths and 6  lines  per 
  1686.      inch).   If  you  have a printer that prints in  compressed  line 
  1687.      formats or uses legal size paper,  for example,  you will want to 
  1688.      change this value.  The range is from 10 to 255.
  1689.  
  1690.      Top, Bottom, and Left Margins
  1691.  
  1692.           It  is possible to specify the number of lines of margin for 
  1693.      output at the top and at the bottom of each page.   Both of these 
  1694.      parameters may be set to any value from 0 to 9.   The top  margin 
  1695.      is the number of lines skipped before the first printable line on 
  1696.      the page (including the header if it is specified).
  1697.           The  bottom  margin is the number of blank lines  after  the 
  1698.      last  printable  line on the page.   This may be the page  number 
  1699.      line if page numbering is activated.
  1700.           The  Left Margin setting allows you to tell T-Ref  how  many 
  1701.      columns  in from the left side to buffer the output.   Values are 
  1702.      from 0 to 20.
  1703.  
  1704.      Printer Column Width
  1705.  
  1706.           Many printers will automatically perform a carriage  return/ 
  1707.      line  feed  when a print line exceeds its maximum  column  width, 
  1708.      then  finishes printing the text on the next line.   Since  T-Ref 
  1709.  
  1710.  
  1711.                                     5-2
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.      cannot  intrinsically  know when this  happens,  "page  creeping" 
  1721.      occurs.   By setting this value,  T-Ref will perform the carriage 
  1722.      return/line  feed operation for the printer;  thus preventing not 
  1723.      only page creeping, but page run-off as well.
  1724.           Note  however,  that this setting is different based on  the 
  1725.      printer mode.   That is,  the Elite printer width is not the same 
  1726.      as the Pica printer width or the Compressed printer width.   Make 
  1727.      sure  you  set  this value to match  the  appropriate  mode  your 
  1728.      printer will be printing in!
  1729.  
  1730.      Printer Sequences
  1731.  
  1732.           The  last  two  parameters are used to send  start  and  end 
  1733.      command  sequences  to  the printer in order  to  change  printer 
  1734.      modes.   It is,  for example,  possible to send commands to  your 
  1735.      printer  to  initially set it into "compressed" or  "draft"  mode 
  1736.      before printing begins and to return it back to the previous  set 
  1737.      mode after the printing is complete.
  1738.           Several  ASCII symbols represent special characters  in  the 
  1739.      command sequence:  "^",  "@",  and "#".  The carrot symbol "^" is 
  1740.      used  to send a CONTROL character (i.e.,  "^R" sends a one  char-
  1741.      acter code of "CTRL R").   The actual ASCII character values sent 
  1742.      range  from  1  ("^A") to 26 ("^Z"),  as well as  27  ("^["),  28 
  1743.      ("^\"), and 29 ("^]").  Only the capitalized alpha characters are 
  1744.      allowed to follow the "^" symbol (A-Z).
  1745.           The  ampersand "@" denotes the ESCAPE character which  is  a 
  1746.      common  character  in  sending  commands  to  the  printer.   For 
  1747.      example,  "@M"  would send a two character command code "ESC  M", 
  1748.      and "@@@" would send a two character command code "ESC @".
  1749.           The  pound  symbol "#" tells T-REF to send a specific  ASCII 
  1750.      character to the printer.  The three numeric characters following 
  1751.      the  pound  symbol is the decimal value of the  ASCII  character.  
  1752.      For  example,  "#027" sends an ESC character;  "#097"  sends  the 
  1753.      letter  "A".   It is important to remember that the numeric char-
  1754.      acter sequence ("0" through "9") following the "#" symbol must be 
  1755.      three characters long.
  1756.  
  1757.      Important Notes
  1758.  
  1759.           1) Do not place blanks or other characters into the sequence 
  1760.      to separate different commands in the sequence.   The  characters 
  1761.      (except for the special characters described above) are sent just 
  1762.      as they are typed in.
  1763.           2) The three special characters ("^",  "@", "#") can be sent 
  1764.      by typing the character twice in sequence.
  1765.  
  1766.      Example
  1767.           
  1768.           To set an EPSON FX into Elite mode at the start of the print 
  1769.      and to put it into PICA at the end, your commands would be:
  1770.  
  1771.        Start Printer Sequence:  @M
  1772.        End Printer Sequence:    @P
  1773.  
  1774.  
  1775.  
  1776.  
  1777.                                     5-3
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.      File Control:
  1787.  
  1788.           The file control feature (enabled with the F8 key)  performs 
  1789.      three  basic  functions:  it allows you to enter a specific  file 
  1790.      path string,  to specify the desired default file extension names 
  1791.      to be used by T-Ref, and to specify whether to create and/or read 
  1792.      XREF  files during the source scan.   (NOTE:  XREF files are  not 
  1793.      included  as  part  of the shareware version of  T-Ref  so  these 
  1794.      fields are inactive for this version.)
  1795.  
  1796.      File Path
  1797.  
  1798.           T-Ref  contains full DOS PATH string support in locating all 
  1799.      relevant  files,  whether it is a T-Ref file (like "T-REF.DB"  or 
  1800.      "T-REF.HLP") or a scan file (like an Include file or XREF  file).  
  1801.      However,  in searching for scan files, it is possible to override 
  1802.      the DOS PATH string with this option.
  1803.           The  file path string works the same as the DOS PATH command 
  1804.      does.  By entering a series of directory file paths (separated by 
  1805.      semicolons),  you  can have T-Ref search the list for  files  not 
  1806.      found  on  the default drive and directory.   Directories may  be 
  1807.      absolute or relative to the default DOS directories.  
  1808.           For example:
  1809.  
  1810.      @FRAME TEXT = \PROJECTS;C:\BACKUP\TP4;FILESRCH\SOURCE;B:..\TOOLS
  1811.  
  1812.      specifies four different directories other than the default drive 
  1813.      and directory.   The first two are absolute.   "\PROJECTS" refers 
  1814.      to  a subdirectory from the root directory of the default  drive.  
  1815.      "C:\BACKUP\TP4" refers to the subdirectory "BACKUP\TP4" from  the 
  1816.      root directory of drive C.
  1817.           The  last  two  paths  are subdirectories  relative  to  the 
  1818.      default directories.  "FILESRCH\SOURCE" is a subdirectory located 
  1819.      within  the present default drive  and  directory.   "B:..\TOOLS" 
  1820.      refers  to a subdirectory "TOOLS" of the parent directory of  the 
  1821.      default directory on drive B.
  1822.           If  the path string is left blank,  T-REF will read the PATH 
  1823.      specification passed by DOS and use that as the path string.   In 
  1824.      addition,  you  can load the DOS PATH string with the CTRL-R  key 
  1825.      sequence.   If you desire, you can then edit the character string 
  1826.      and save it.   
  1827.  
  1828.      File Extension Names
  1829.           
  1830.           The  file extension default string parameters allow  you  to 
  1831.      change the extension defaults.   These strings determine the name 
  1832.      extensions  of files to be read from (such as in "Source  Input") 
  1833.      or  written to (such as "Source Output",  "XREF Unit  File",  and 
  1834.      "XREF Include File").
  1835.           The "Source Input" and "Source Output" extension deal solely 
  1836.      with  the "Active Input File" and "Active Output File" parameters 
  1837.      respectively  on the main screen.   When file extensions are  not 
  1838.      included  in those parameters,  they default to those  designated 
  1839.      here.   (Like the Turbo Pascal compiler,  if a file extension  is 
  1840.      not  given  for  Include file compiler directives and  USES  unit 
  1841.  
  1842.  
  1843.                                     5-4
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.      files, '.PAS' is always assumed.)
  1853.           The  XREF Unit and Include File extensions tell  T-REF  what 
  1854.      file  extension  names are to be given to the  identifier  (XREF) 
  1855.      files  generated  when  T-REF  scans  Units  and  Include  files.  
  1856.      However,  XREF  files  are not supported with  this  version,  so 
  1857.      changing  these  extension  strings will have no  effect  on  the 
  1858.      execution of T-Ref.
  1859.  
  1860.      Read Unit XREF Files
  1861.  
  1862.           Inactive for this version.
  1863.  
  1864.      Creating XREF Files
  1865.  
  1866.           Inactive for this version.
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                                     5-5
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.                        Chapter 6 - T-Ref Quick Start
  1919.  
  1920.  
  1921.           This  chapter is meant to help familiarizing you with  T-Ref 
  1922.      and  guide  you in setting up the T-Ref system to best  fit  your 
  1923.      personal needs and system hardware.   
  1924.           I  suggest  that you follow the first step in  this  chapter 
  1925.      (making  a backup copy of the T-Ref program package) before  ever 
  1926.      running  the program.   Once you have done this,  you can  either 
  1927.      perform the remaining steps immediately or any time later.  Those 
  1928.      remaining  steps will assist you in how to instruct T-Ref of your 
  1929.      system's  hardware.   
  1930.  
  1931.  
  1932.      Backing Up T-Ref:
  1933.  
  1934.           Immediately  after  opening your T-Ref package,  you  should 
  1935.      make  at least one copy of the entire disk.   The program is  not 
  1936.      copy-protected,  so  all that is necessary is a "COPY  s:*.*  t:" 
  1937.      command,  where 's:' is the source drive the enclosed diskette is 
  1938.      on  and 't:' is the target drive the blank formatted diskette  is 
  1939.      on.   After completing the copy process, put the original disk in 
  1940.      a safe place.   If anything happens to your copy,  you still have 
  1941.      the original to make additional copies from.
  1942.  
  1943.  
  1944.      Building the Database File:
  1945.  
  1946.           Next,  run  the program called INITDB.   This  program  will 
  1947.      create  the database file you will use for saving and  retrieving 
  1948.      your  parameter  settings.   The file created by this program  is 
  1949.      called T-REF.DB.  After running the program, verify this file now 
  1950.      exists.
  1951.  
  1952.  
  1953.      Executing T-Ref:
  1954.  
  1955.           Running  the main driver is as simple as typing T-REF at the 
  1956.      DOS command line.   The program will load and the "driver" screen 
  1957.      (see Chapter 1,  "T-Ref's Driver Program") will appear.  Note the 
  1958.      block  cursor  is  at the  'Active  Directory'  field,  which  is 
  1959.      presently blank.  
  1960.  
  1961.  
  1962.      Setting the Default Parameters:
  1963.  
  1964.           When T-Ref loads, one of the first actions it performs is to 
  1965.      load one of the database's combination of parameter settings into 
  1966.      memory.   
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.                                     6-1
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.      I/O Control Features
  1985.  
  1986.           a) Screen Control Parameters
  1987.  
  1988.           The very next step once the driver shell is loaded should be 
  1989.      to  set  the various color attributes that you like to work  with 
  1990.      (if  you  have  a color or EGA monitor card) and  to  tell  T-Ref 
  1991.      whether your CGA produces "snow" during memory  contentions.   If 
  1992.      you  have a monochrome monitor card and monochrome  monitor,  you 
  1993.      can skip this step.   For more on the color selections and "snow" 
  1994.      settings, see Chapter 5, "Screen Control".
  1995.  
  1996.           b) Printer Control Parameters
  1997.  
  1998.           You will need to give T-Ref information about your  printer.  
  1999.      Through the 'Printer Control Window', set the proper printer port 
  2000.      for  your  system,  the  number of lines per  page  your  printer 
  2001.      supports,  and  the margins that you most likely will  use.   See 
  2002.      Chapter 5, "Printer Control" for more details.
  2003.           The number of lines per page will most likely be 66 (6 lines 
  2004.      per inch times 11 inches).   If your printer supports other  than 
  2005.      standard printing characteristics, set the value appropriately.
  2006.           Also,  set  the  printer  column width to  the  most  common 
  2007.      setting.   Remember that some printers can have different printer 
  2008.      column  maximum widths based on the printer  mode  (i.e.,  Elite, 
  2009.      Pica,  Compressed, etc.).  Set this based on the most common mode 
  2010.      you will be printing in.
  2011.           Finally,  if you plan on printing most often in a mode other 
  2012.      than the one the printer is normally in, you will need to specify 
  2013.      a  start  and  end printer command sequence.   Use  your  printer 
  2014.      manual to determine the command codes your printer accepts.
  2015.  
  2016.           c) File Control Parameters
  2017.  
  2018.           Next,  under the 'File Control Window',  you need to  decide 
  2019.      whether or not to enter a directory PATH string for T-Ref to use.  
  2020.      If  you  have your source code organized into only a  few  direc-
  2021.      tories,  you  may wish to enter the PATHs to them.   If you  have 
  2022.      different  directories for each project or program you are devel-
  2023.      oping, you may wish to leave this field blank and enter the PATHs 
  2024.      for each project individually.
  2025.  
  2026.      Source Lister Options
  2027.  
  2028.           In  the Source Lister area of the driver shell,  you  should 
  2029.      decide  which word formats you will want most often for  reserved 
  2030.      words and identifiers.
  2031.           If  you  wish to create a generic header  template  for  the 
  2032.      source lister, now would be the time to do so.  Strike the F3 key 
  2033.      for the source lister header window.   You may, for example, wish 
  2034.      to put your name,  company,  address,  copyright statements,  and 
  2035.      even  determine file name and present date/time locations in  the 
  2036.      header.  See chapter 4 for more on setting up headers.
  2037.  
  2038.  
  2039.  
  2040.  
  2041.                                     6-2
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.           In addition,  you should set the 'Active Procedure/Function' 
  2051.      column  width  field  to the maximum input width  of  the  normal 
  2052.      source code (see Chapter 2, "Active Procedure/Function").
  2053.  
  2054.  
  2055.      Cross Reference Lister Options
  2056.  
  2057.           In  the Reference Lister area of the driver shell,  you  may 
  2058.      wish to set the detail level and your most frequently used object 
  2059.      selection parameter settings.
  2060.           Like  the  source lister,  you may wish to create a  generic 
  2061.      header template for the cross reference lister.   Use the F4  key 
  2062.      to  bring  up  the header window and enter the text  and  dynamic 
  2063.      fields as you did with the source lister.
  2064.  
  2065.  
  2066.      Saving the New Settings:
  2067.  
  2068.           Once  you have gotten to this point,  you are ready to  save 
  2069.      the settings to the database file.  Strike the F10 key.  When the 
  2070.      'Write  Database' window appears,  make sure the block cursor  is 
  2071.      over the selector "SYSTEM" (option 0).   Then hit  RETURN.   Now, 
  2072.      each  time T-Ref is called and the default SYSTEM combination  is 
  2073.      loaded, the settings you have saved will be loaded.
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.                                     6-3
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.                   Chapter 7 - Commercial Version of T-Ref
  2117.  
  2118.  
  2119.           In this chapter, I will describe the differences between the 
  2120.      shareware version of T-Ref which you are using and the commercial 
  2121.      version  of  T-Ref which is available at the $45 level of  regis-
  2122.      tration.
  2123.  
  2124.  
  2125.      The T-Ref Shell:
  2126.  
  2127.           There  are  very  few  differences  between  the  commercial 
  2128.      version  of T-Ref and the shareware version.   Many of the selec-
  2129.      tion restrictions are obviously removed to provide the additional 
  2130.      features of the commercial version.
  2131.  
  2132.           Scripting
  2133.  
  2134.           One benefit gained is the scripting feature offered with the 
  2135.      commercial  version.   With this feature,  you can  automatically 
  2136.      scan a sequence of files by passing the name of a file containing 
  2137.      the source file names,  rather than the source itself.  Thus, you 
  2138.      can quickly produce printable source and cross reference listings 
  2139.      with a single command.
  2140.  
  2141.           Extended Database Set
  2142.  
  2143.           The commercial version supports the ability to save up to 10 
  2144.      combinations  of parameter settings,  where the shareware version 
  2145.      only allows 2.
  2146.  
  2147.           Printer Hold File
  2148.  
  2149.           It  is  possible  with the commercial version to  route  the 
  2150.      output from the scan to a printer hold file,  which,  in addition 
  2151.      to the normal text,  contains printer commands,  page ejects, and 
  2152.      other information used to manipulate the printer.   From the hold 
  2153.      file,  you just simply need to perform a PRINT or COPY command to 
  2154.      send the file to the printer.   (This is especially nice when you 
  2155.      wish to generate the output on one computer,  and print the files 
  2156.      from another.)
  2157.  
  2158.           PRINT Interface
  2159.  
  2160.           DOS  3.X  provides a resident utility  called  PRINT,  which 
  2161.      among other things,  allows you to submit files for printing to a 
  2162.      print spooler.   The resident utility then maintains the list  of 
  2163.      files  that need to be printed,  and performs this action in  the 
  2164.      background.    The  commercial  version  of  T-Ref  can  directly 
  2165.      interface  with  the PRINT utility by creating a print  file  and 
  2166.      then submitting the file for printing.  Thus, you can continue to 
  2167.      scan other files while printing occurs in the background, and you 
  2168.      are no longer restricted to the speed of your printer.
  2169.  
  2170.  
  2171.  
  2172.  
  2173.                                     7-1
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.      The Scanner Program:
  2184.  
  2185.  
  2186.           Calling the Scanner from DOS
  2187.  
  2188.           The  commercial  version of T-Ref supports  the  feature  of 
  2189.      directly calling the scanner program from DOS, rather from the T-
  2190.      Ref  shell.   This provides the scanner with the addition  memory 
  2191.      that  the  shell  program normally takes up.   When  calling  the 
  2192.      scanner from the DOS line,  you pass in the name used to identify 
  2193.      the  database parameter set saved.   The scanner then  loads  the 
  2194.      database, and executes the scan automatically.
  2195.  
  2196.           XRU and XRI files
  2197.  
  2198.           Definitely  the most unique feature of T-Ref is its  ability 
  2199.      to not only scan files for listing purposes,  but to also  create 
  2200.      identifier files about the identifiers found during the course of 
  2201.      the  scan.   Once  created,  these identifier files can  then  be 
  2202.      "linked"  into other scans and the identifiers that would  appear 
  2203.      (through the use of the USES clause for example) become available 
  2204.      for referencing.
  2205.           XRU  files are created from Unit Files,  and contain all  of 
  2206.      the  identifiers  declared in the INTERFACE portion of the  unit.  
  2207.      T-Ref can then be told to LINK such files into the scan of  other 
  2208.      units  when references to those units are encountered in the USES 
  2209.      clause of the scanning unit.
  2210.           Benefits  from such a feature include more  accurate  infor-
  2211.      mation about the use of variables.   For example,  with XRU files 
  2212.      linked,  T-Ref  ALWAYS knows when variables are set by procedural 
  2213.      calls and the variable is passed as a  parameter.   Also,  decla-
  2214.      rations from TYPEs declared in other units are more accurate.
  2215.           XRI files are created from Include Files,  and once created, 
  2216.      can  be linked into other source files that reference them rather 
  2217.      than having to continuously scan them.  Linking occurs in seconds 
  2218.      while having to scan them over and over takes minutes.
  2219.           The  commercial  version includes XRU files already  created 
  2220.      for  all  of  the  identifiers found in  the  Turbo  Pascal  unit 
  2221.      library: DOS, CRT, PRINTER, GRAPH, TURBO3, GRAPH3, and OVERLAY.
  2222.  
  2223.  
  2224.      The Source Lister:
  2225.  
  2226.           Graphics Block Diagramming
  2227.  
  2228.           As  an alternative to the ASCII style of block  diagramming, 
  2229.      the  commercial  version also provides a  GRAPHICS  style.   This 
  2230.      option  uses the IBM extended character set to produce the  block 
  2231.      diagrams.
  2232.  
  2233.  
  2234.      The Cross Referencer:
  2235.  
  2236.  
  2237.  
  2238.  
  2239.                                     7-2
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.           Detail Levels 4 and 5
  2249.  
  2250.           Even  the shareware maximum level 3 does not  actually  show 
  2251.      all  of  the  information  T-Ref can  produce  about  the  source 
  2252.      scanned.  The commercial version supports levels 4 and 5 as well.  
  2253.      At  levels  4  and 5,  associated file names are given  with  the 
  2254.      declaration, as well as with the references.  References are also 
  2255.      grouped by the procedures of the references.
  2256.           Various  warnings  and  notes  are  also  listed  with   the 
  2257.      references.  There are 5 different warnings T-Ref generates about 
  2258.      the  scanned code and two notes.   Warnings include flagging when 
  2259.      variable  formal  parameters are never set,  when  functions  are 
  2260.      never  set,  when loop variables are set within the  loop  block, 
  2261.      when  variables  are not set before their use,  and when  forward 
  2262.      declared  functions/procedures are never fully  declared.   Notes 
  2263.      include  when  formal  parameters are set to  a  value  and  when 
  2264.      recursive,  inline,  interrupt,  far,  and external procedures or 
  2265.      functions are declared.
  2266.  
  2267.           Remote Identifier Listing
  2268.  
  2269.           With  the use of cross reference (XRU) files generated by T-
  2270.      Ref,  it  is possible to load and list references to  identifiers 
  2271.      declared in other units.
  2272.  
  2273.           Scanning Conditionals
  2274.  
  2275.           The  commercial  version  of T-Ref can also be told  to  act 
  2276.      exactly like the Turbo compiler in how it sees the source code it 
  2277.      is  scanning.   The compiler will ignore certain portions of  the 
  2278.      code  when conditional statements are encountered on  the  input.  
  2279.      T-Ref  can be told to act just the same,  skipping over  whatever 
  2280.      code resides within conditionals.  T-Ref does this by tracking on 
  2281.      what conditional symbols are defined and takes appropriate action 
  2282.      when encountering the IFDEF, IFNDEF, and IFOPT directives.
  2283.  
  2284.           Conditionals and Compiler Directive listings
  2285.  
  2286.           Included  in the cross reference listings of the  commercial 
  2287.      version  are the conditional listing and the  compiler  directive 
  2288.      listing.   In  the  conditional listing,  T-Ref lists all of  the 
  2289.      conditional symbols found during the scan.  From the listing, you 
  2290.      can  determine  on  what  lines the  symbols  were  DEFINE'd  and 
  2291.      UNDEF'ined, as well as what lines they were referenced.
  2292.           The  compiler  directive listing lists all of  the  compiler 
  2293.      directives found during the scan, the lines referenced, and a "+" 
  2294.      or  "-" symbol (where appropriate) corresponding to  their  being 
  2295.      turned ON or OFF respectively.
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.                                     7-3
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.